package net.wangds.utils;

import junit.framework.TestCase;
import net.wangds.log.helper.LogHelper;
import net.wangds.utils.DownloadUtils;
import org.junit.Test;

import java.io.File;

public class HttpUtilsTestCase {

    @Test
    public void testDownload(){
        LogHelper.info("测试文件下载");
        File out = new File(System.getProperty("user.home"), "baidu.ico");
        DownloadUtils.syncDownload2File("https://www.baidu.com/favicon.ico", out);
        TestCase.assertTrue(out.exists());
        TestCase.assertTrue(out.length()>0);
        TestCase.assertTrue(out.delete());
    }

}
